<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		
		<script type="text/javascript">
			
			/*function test(){
				var arr = [];
				for (var i = 0; i < 10; i++) {
					arr[i] = function(){
						console.log(i);
					}
				}
				return arr;
			}
			var myArr = test();
			for (var i = 0; i < 10; i++) {
				myArr[i]();
			}//10 10 10 10 10 10 10 10 10 10 */
			
			/*
			 * 重点
			 */
			/*function test(){
				var arr = [];
				for (var i = 0; i < 10; i++) {
					(function(j){
						arr[j] = function (){
							console.log(j);
						}
					}(i));
				}
				return arr;
			}
			var myArr = test();
			for (var i = 0; i < 10; i++) {
				myArr[i]();
			}*/
			
			
			
			
			
		</script>
	</body>
</html>
